package gold.digger;


import javafx.util.Pair;


/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LCJZOF69 {
    public long startExecuteTime = System.currentTimeMillis();

    class Solution {
        // 根据 arr[i-1] < arr[i] 在 [1,n-1] 范围内找值
        // 峰顶元素为符合条件的最靠近中心的元素
        public int peakIndexInMountainArray(int[] arr) {
            int n = arr.length;
            int l = 1, r = n - 1;
            while (l < r) {
                int mid = l + r + 1 >> 1;
                if (arr[mid - 1] < arr[mid]) l = mid;
                else r = mid - 1;
            }
            return r;
        }
    }


    public static void main(String[] args) throws Exception {
        LCJZOF69 an = new LCJZOF69();
        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
